package com.example.springdemo.service;

import java.util.List;

import com.example.springdemo.entity.Productreviews;
import com.example.springdemo.mapper.ProductreviewsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 商品评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-08
 */
@Service
public class ProductreviewsServiceImpl implements IProductreviewsService
{
    @Autowired
    private ProductreviewsMapper productreviewsMapper;

    /**
     * 查询商品评论
     * 
     * @param reviewid 商品评论主键
     * @return 商品评论
     */
    @Override
    public Productreviews selectProductreviewsByReviewid(String reviewid)
    {
        return productreviewsMapper.selectProductreviewsByReviewid(reviewid);
    }

    @Override
    public List<Productreviews> selectCommentBygid(String productid) {
        return productreviewsMapper.selectCommentBygid(productid);
    }

    /**
     * 查询商品评论列表
     * 
     * @param productreviews 商品评论
     * @return 商品评论
     */
    @Override
    public List<Productreviews> selectProductreviewsList(Productreviews productreviews)
    {
        return productreviewsMapper.selectProductreviewsList(productreviews);
    }

    /**
     * 新增商品评论
     * 
     * @param productreviews 商品评论
     * @return 结果
     */
    @Override
    public int insertProductreviews(Productreviews productreviews)
    {
        return productreviewsMapper.insertProductreviews(productreviews);
    }

    /**
     * 修改商品评论
     * 
     * @param productreviews 商品评论
     * @return 结果
     */
    @Override
    public int updateProductreviews(Productreviews productreviews)
    {
        return productreviewsMapper.updateProductreviews(productreviews);
    }

    /**
     * 批量删除商品评论
     * 
     * @param reviewids 需要删除的商品评论主键
     * @return 结果
     */
    @Override
    public int deleteProductreviewsByReviewids(String[] reviewids)
    {
        return productreviewsMapper.deleteProductreviewsByReviewids(reviewids);
    }

    /**
     * 删除商品评论信息
     * 
     * @param reviewid 商品评论主键
     * @return 结果
     */
    @Override
    public int deleteProductreviewsByReviewid(String reviewid)
    {
        return productreviewsMapper.deleteProductreviewsByReviewid(reviewid);
    }
}
